package w4156.idog.server;

import javax.ejb.Stateful;
import javax.naming.InitialContext;
import w4156.idog.model.User;

/**
 * Session Bean implementation class AdministratorSessionBean
 */
@Stateful(mappedName = "ejb/eBlackjack/AdmininistratorSLSB")
public class AdministratorSessionBean extends UserSessionBean implements
		AdministratorSessionBeanRemote {

	 
	PlayerManagerBeanRemote playerMgr;
	 private void init() {
	        try {
	        	playerMgr = null;
	    		InitialContext context = new InitialContext();
	    		playerMgr = (PlayerManagerBeanRemote) context.lookup("ejb/eBlackjack/PlayerManagerSLSB");
	        } catch (Exception e) {
	            e.printStackTrace();
	        }
		}
	/**
	 * @see UserSessionBean#UserSessionBean()
	 */
	public AdministratorSessionBean() {
		super();
		init();
		// TODO Auto-generated constructor stub
	}

	@Override
	public void ModifyUser(User user) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void createUser(User user) {
		// TODO Auto-generated method stub
		playerMgr.createUser(user);
	}

	@Override
	public void deleteUser(User user) {
		// TODO Auto-generated method stub
		playerMgr.delete(user);
	}

}
